<?php

class IndexController extends Zend_Controller_Action {

    public function indexAction() {
        $link = sqlsrv_connect(".", array(
            "UID" => "user",
            "PWD" => "zzz",
            "Database" => "health_alt"
                ));
        $query = sqlsrv_query($link, "select Value, Date from DataStorage where Date IS NULL");
        $row = sqlsrv_fetch_array($query);
        echo $row['Value'] . $row['Date'];

        echo "<img src='http://heart-disease.ru:2525/default/index/image' />";
    }

    public function imageAction() {
        /* $link = sqlsrv_connect(".", array(
          "UID" => "user",
          "PWD" => "zzz",
          "Database" => "health_alt"
          ));
          $query = sqlsrv_query($link, "select Value from DataStorage where Date IS NULL");
          $row = sqlsrv_fetch_array($query);
          $this->_helper->layout->disableLayout();
          $this->_helper->viewRenderer->setNoRender(TRUE);
          header("Content-Type: image/png");
          echo $row['Value']; */
    }

    public function failAction() {
        throw new Some_Exception('Some exception.');
    }

}

class Some_Exception extends Zend_Exception {
    
}